package library.user;

import library.ListBook;
import library.operation.IOperation;
//抽象用户类
public abstract class User {
    protected String name;  //用户姓名
    IOperation[] operation; //操作数组
    //构造函数
    public User(String name){
        this.name = name;
    }
    //抽象函数
    public abstract int menu();
    //工作操作函数
    public void work(int choice, ListBook listBook){
        if(choice < 0 && choice >= operation.length){
            System.out.println("输入的操作序号非法");
            return;
        }
        operation[choice].work(listBook);
    }

}
